﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="PedidosDataSet" targetNamespace="http://tempuri.org/PedidosDataSet.xsd" xmlns:mstns="http://tempuri.org/PedidosDataSet.xsd" xmlns="http://tempuri.org/PedidosDataSet.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="PedidosConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="PedidosConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.CSharp2.Capitulo02.Produtos.Properties.Settings.GlobalReference.Default.PedidosConnectionString" Provider="System.Data.SqlClient" />
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="TipoProdutoTableAdapter" GeneratorDataComponentClassName="TipoProdutoTableAdapter" Name="TipoProduto" UserDataComponentName="TipoProdutoTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="PedidosConnectionString (Settings)" DbObjectName="Pedidos.dbo.TipoProduto" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
                <DeleteCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>DELETE FROM [dbo].[TipoProduto] WHERE (([Id] = @Original_Id) AND ([Descricao] = @Original_Descricao))</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_Id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Descricao" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Descricao" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </DeleteCommand>
                <InsertCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>INSERT INTO [dbo].[TipoProduto] ([Descricao]) VALUES (@Descricao);
SELECT Id, Descricao FROM TipoProduto WHERE (Id = SCOPE_IDENTITY())</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Descricao" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Descricao" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </InsertCommand>
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>SELECT Id, Descricao FROM dbo.TipoProduto</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
                <UpdateCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>UPDATE [dbo].[TipoProduto] SET [Descricao] = @Descricao WHERE (([Id] = @Original_Id) AND ([Descricao] = @Original_Descricao));
SELECT Id, Descricao FROM TipoProduto WHERE (Id = @Id)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Descricao" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Descricao" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_Id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Descricao" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Descricao" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="Id" ColumnName="Id" DataSourceName="Pedidos.dbo.TipoProduto" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@Id" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </UpdateCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Id" DataSetColumn="Id" />
              <Mapping SourceColumn="Descricao" DataSetColumn="Descricao" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="ProdutoTableAdapter" GeneratorDataComponentClassName="ProdutoTableAdapter" Name="Produto" UserDataComponentName="ProdutoTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="PedidosConnectionString (Settings)" DbObjectName="Pedidos.dbo.Produto" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
                <DeleteCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>DELETE FROM [dbo].[Produto] WHERE (([Id] = @Original_Id) AND ([TipoProduto_Id] = @Original_TipoProduto_Id) AND ([Descricao] = @Original_Descricao) AND ([Custo] = @Original_Custo))</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_Id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_TipoProduto_Id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TipoProduto_Id" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Descricao" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Descricao" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Decimal" Direction="Input" ParameterName="@Original_Custo" Precision="9" ProviderType="Decimal" Scale="2" Size="0" SourceColumn="Custo" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </DeleteCommand>
                <InsertCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>INSERT INTO [dbo].[Produto] ([TipoProduto_Id], [Descricao], [Custo]) VALUES (@TipoProduto_Id, @Descricao, @Custo);
SELECT Id, TipoProduto_Id, Descricao, Custo FROM Produto WHERE (Id = SCOPE_IDENTITY())</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@TipoProduto_Id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TipoProduto_Id" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Descricao" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Descricao" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Decimal" Direction="Input" ParameterName="@Custo" Precision="9" ProviderType="Decimal" Scale="2" Size="0" SourceColumn="Custo" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </InsertCommand>
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>SELECT Id, TipoProduto_Id, Descricao, Custo FROM dbo.Produto</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
                <UpdateCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>UPDATE [dbo].[Produto] SET [TipoProduto_Id] = @TipoProduto_Id, [Descricao] = @Descricao, [Custo] = @Custo WHERE (([Id] = @Original_Id) AND ([TipoProduto_Id] = @Original_TipoProduto_Id) AND ([Descricao] = @Original_Descricao) AND ([Custo] = @Original_Custo));
SELECT Id, TipoProduto_Id, Descricao, Custo FROM Produto WHERE (Id = @Id)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@TipoProduto_Id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TipoProduto_Id" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Descricao" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Descricao" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Decimal" Direction="Input" ParameterName="@Custo" Precision="9" ProviderType="Decimal" Scale="2" Size="0" SourceColumn="Custo" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_Id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_TipoProduto_Id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TipoProduto_Id" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Descricao" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Descricao" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Decimal" Direction="Input" ParameterName="@Original_Custo" Precision="9" ProviderType="Decimal" Scale="2" Size="0" SourceColumn="Custo" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="Id" ColumnName="Id" DataSourceName="Pedidos.dbo.Produto" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@Id" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </UpdateCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Id" DataSetColumn="Id" />
              <Mapping SourceColumn="TipoProduto_Id" DataSetColumn="TipoProduto_Id" />
              <Mapping SourceColumn="Descricao" DataSetColumn="Descricao" />
              <Mapping SourceColumn="Custo" DataSetColumn="Custo" />
            </Mappings>
            <Sources />
          </TableAdapter>
        </Tables>
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="PedidosDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="True" msprop:Generator_DataSetName="PedidosDataSet" msprop:Generator_UserDSName="PedidosDataSet">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="TipoProduto" msprop:Generator_TableClassName="TipoProdutoDataTable" msprop:Generator_TableVarName="tableTipoProduto" msprop:Generator_RowChangedName="TipoProdutoRowChanged" msprop:Generator_TablePropName="TipoProduto" msprop:Generator_RowDeletingName="TipoProdutoRowDeleting" msprop:Generator_RowChangingName="TipoProdutoRowChanging" msprop:Generator_RowEvHandlerName="TipoProdutoRowChangeEventHandler" msprop:Generator_RowDeletedName="TipoProdutoRowDeleted" msprop:Generator_RowClassName="TipoProdutoRow" msprop:Generator_UserTableName="TipoProduto" msprop:Generator_RowEvArgName="TipoProdutoRowChangeEvent">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Id" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnId" msprop:Generator_ColumnPropNameInRow="Id" msprop:Generator_ColumnPropNameInTable="IdColumn" msprop:Generator_UserColumnName="Id" type="xs:int" />
              <xs:element name="Descricao" msprop:Generator_ColumnVarNameInTable="columnDescricao" msprop:Generator_ColumnPropNameInRow="Descricao" msprop:Generator_ColumnPropNameInTable="DescricaoColumn" msprop:Generator_UserColumnName="Descricao">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="Produto" msprop:Generator_TableClassName="ProdutoDataTable" msprop:Generator_TableVarName="tableProduto" msprop:Generator_TablePropName="Produto" msprop:Generator_RowDeletingName="ProdutoRowDeleting" msprop:Generator_RowChangingName="ProdutoRowChanging" msprop:Generator_RowEvHandlerName="ProdutoRowChangeEventHandler" msprop:Generator_RowDeletedName="ProdutoRowDeleted" msprop:Generator_UserTableName="Produto" msprop:Generator_RowChangedName="ProdutoRowChanged" msprop:Generator_RowEvArgName="ProdutoRowChangeEvent" msprop:Generator_RowClassName="ProdutoRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Id" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnId" msprop:Generator_ColumnPropNameInRow="Id" msprop:Generator_ColumnPropNameInTable="IdColumn" msprop:Generator_UserColumnName="Id" type="xs:int" />
              <xs:element name="TipoProduto_Id" msprop:Generator_ColumnVarNameInTable="columnTipoProduto_Id" msprop:Generator_ColumnPropNameInRow="TipoProduto_Id" msprop:Generator_ColumnPropNameInTable="TipoProduto_IdColumn" msprop:Generator_UserColumnName="TipoProduto_Id" type="xs:int" />
              <xs:element name="Descricao" msprop:Generator_ColumnVarNameInTable="columnDescricao" msprop:Generator_ColumnPropNameInRow="Descricao" msprop:Generator_ColumnPropNameInTable="DescricaoColumn" msprop:Generator_UserColumnName="Descricao">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Custo" msprop:Generator_ColumnVarNameInTable="columnCusto" msprop:Generator_ColumnPropNameInRow="Custo" msprop:Generator_ColumnPropNameInTable="CustoColumn" msprop:Generator_UserColumnName="Custo" type="xs:decimal" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:TipoProduto" />
      <xs:field xpath="mstns:Id" />
    </xs:unique>
    <xs:unique name="Produto_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:Produto" />
      <xs:field xpath="mstns:Id" />
    </xs:unique>
  </xs:element>
  <xs:annotation>
    <xs:appinfo>
      <msdata:Relationship name="FK_Produto_TipoProduto" msdata:parent="TipoProduto" msdata:child="Produto" msdata:parentkey="Id" msdata:childkey="TipoProduto_Id" msprop:Generator_UserChildTable="Produto" msprop:Generator_ChildPropName="GetProdutoRows" msprop:Generator_UserRelationName="FK_Produto_TipoProduto" msprop:Generator_ParentPropName="TipoProdutoRow" msprop:Generator_RelationVarName="relationFK_Produto_TipoProduto" msprop:Generator_UserParentTable="TipoProduto" />
    </xs:appinfo>
  </xs:annotation>
</xs:schema>